package com.job.sun.HomeWork0709;

import java.util.Scanner;

/**
 * @author 张春阳
 * @version 1.0
 * @since 2022-07-10 22:11:22
 */
public class TestFood {
    public static void main(String[] args) {
        Fruit food = new Lemon();
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你喜欢的水果");
        System.out.println("水果的编号为:1.柠檬 2.苹果 3.胡萝卜");
        int nums = sc.nextInt();

            if(nums==1){
                food=new Lemon();
            }else if(nums==2){
                food =new Apple();
            }else if(nums==3){
                food=new Carrot();
            }else {
                System.out.println("没有此类型水果");
            }

          MyHelp.stomachCapacity(food);

    }
}